package practice.com0227;

import java.util.Arrays;
import java.util.Scanner;

/**
 * 简直太棒了，精神可谓，牛气冲天，加油加油加加油！
 * stats  统计
 */
public class Stats {
    public static void stats() {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一串字符：");
        String str = sc.next();
        char[] arr = str.toCharArray();
        System.out.println(Arrays.toString(arr));
        int count = 0 ;
        int count1 = 0;
        for (int i = 0; i < arr.length; i++) {
            if (str.codePointAt(i) >= 65 && str.codePointAt(i) < 122) {
                count = count + 1;

            } else if (str.codePointAt(i) >= 48 && str.codePointAt(i) < 57) {
                count1 +=1;

            }else {
            }
        }
        System.out.println("英文字母有" + count + "个，" + "数字有" + count1 + "个。");

    }

    public static void main(String[] args) {
        stats();
    }
}
